import React from 'react';

import styles from './textcard.css';


class TextCard extends React.Component {

  render() {
    let {cardTitle, cardContent, defaultContent} = this.props;
    cardContent = cardContent.replace(/\n/g, '<br/>');

    return (
      <div className={styles.card_container}>
        <div className={styles.card_title}>
          {cardTitle}
        </div>
        <div className={styles.card_content + ' ' + (defaultContent ? styles.card_content_default : '')}
             dangerouslySetInnerHTML={{__html: cardContent}}>
        </div>
      </div>
    );
  }
}


export default TextCard;
